{# Template for C++ class header file #}
{% if file_header %}
{{ file_header }}

{% endif %}
{%- if use_pragma_once %}
#pragma once
{% else %}
#ifndef {{ header_guard }}
#define {{ header_guard }}
{% endif %}

{%- if includes %}
{{ includes }}

{% endif %}
{%- if namespace_parts %}
namespace {{ namespace_parts | join('::') }} {

{% endif %}
{%- if class_comment %}
{{ class_comment }}
{% endif %}
class {{ class_name }}{% if base_classes %} : {{ base_classes | join(', ') }}{% endif %} {
{%- if public_methods or public_fields or constructors or destructor %}
public:
{%- if constructors %}
{%- for ctor in constructors %}
    {{ ctor.comment | indent(4, first=True) if ctor.comment }}
    {{ ctor.signature | indent(4, first=True) }};
{%- if not loop.last %}

{%- endif %}
{%- endfor %}
{% endif %}
{%- if destructor %}

    {{ destructor.comment | indent(4, first=True) if destructor.comment }}
    {{ destructor.signature | indent(4, first=True) }};
{%- endif %}
{%- if public_methods %}

{%- for method in public_methods %}
    {{ method.comment | indent(4, first=True) if method.comment }}
    {{ method.signature | indent(4, first=True) }};
{%- if not loop.last %}

{%- endif %}
{%- endfor %}
{%- endif %}
{%- if public_fields %}

{%- for field in public_fields %}
    {{ field.comment | indent(4, first=True) if field.comment }}
    {{ field.declaration | indent(4, first=True) }};
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if protected_methods or protected_fields %}

protected:
{%- if protected_methods %}
{%- for method in protected_methods %}
    {{ method.comment | indent(4, first=True) if method.comment }}
    {{ method.signature | indent(4, first=True) }};
{%- if not loop.last %}

{%- endif %}
{%- endfor %}
{%- endif %}
{%- if protected_fields %}

{%- for field in protected_fields %}
    {{ field.comment | indent(4, first=True) if field.comment }}
    {{ field.declaration | indent(4, first=True) }};
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if private_methods or private_fields %}

private:
{%- if private_methods %}
{%- for method in private_methods %}
    {{ method.comment | indent(4, first=True) if method.comment }}
    {{ method.signature | indent(4, first=True) }};
{%- if not loop.last %}

{%- endif %}
{%- endfor %}
{%- endif %}
{%- if private_fields %}

{%- for field in private_fields %}
    {{ field.comment | indent(4, first=True) if field.comment }}
    {{ field.declaration | indent(4, first=True) }};
{%- endfor %}
{%- endif %}
{%- endif %}
};
{%- if namespace_parts %}

}  // namespace {{ namespace_parts | join('::') }}
{%- endif %}
{% if not use_pragma_once %}

#endif  // {{ header_guard }}
{%- endif %}
